#define content_toutiao()
<div class="box box-warning box-jianshu">
    <div class="box-header with-border">
        <h3 class="box-title">头条账号设置</h3>
        <div class="pull-right">
            <label>启用</label>
            <input type="hidden" id="toutiao" name="toutiao" value="#(toutiao.enable ?? false)"/>
            <input type="checkbox" id="toutiao_enable" class="switchery platform-enable" data-for="toutiao"
                   data-switchery="true" style="display: none;" #(toutiao.enable ? "checked" : "")/>
            <!--#(toutiao.enable == "false")-->
            <!--#(toutiao.enable == false)-->
        </div>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <!-- 头条账号ID - media_id -->
        <div class="col-xs-4">
            <div class="form-group col-xs-12">
                <label>头条号ID</label>
                <input type="text" id="toutiao_mediaId" class="form-control" value="#(toutiao.mediaId)" placeholder="1234567">
            </div>
            <div class="form-group col-xs-12">
                <label>仅草稿</label>
                <i class="fa fa-fw fa-question-circle" onclick="showDraftOnlyHelp()" style="cursor:pointer"></i>
                <input type="hidden" id="draftOnly" name="draftOnly" value="#(toutiao.toutiao_draftOnly ?? false)"/>
                <input type="checkbox" id="toutiao_draftOnly" class="switchery" data-for="draftOnly"
                       data-switchery="true" style="display: none;" #(toutiao.draftOnly ? "checked" : "")/>
            </div>
        </div>
        <!-- 头条账号ID - media_id -->
        <div class="col-xs-8">
            <!-- 简书Cookie设置 -->
            <div class="form-group col-xs-12">
                <label>Cookie</label>
                <!--_mp_auth_key=xxxxxxx;-->
                <textarea class="form-control" id="toutiao_cookie" rows="3" placeholder="sessionid=xxxxxxxx;">#(toutiao.cookie)</textarea>
            </div>
        </div>
    </div>
    <!-- /.box-body -->
    <div class="box-footer">
        <button type="button" class="btn btn-default"
                onclick="doverify('toutiao', getToutiaoConfObj())">
            <i class="fa fa-cog fa-spin fa-fw" style="display:none"></i>验证
        </button>
        <a href="https://www.jianshu.com/p/974944ddfd81" target="_blank">
            <i class="fa fa-fw fa-question-circle"></i>怎么找到这些配置
        </a>
        <button type="button" class="btn btn-info pull-right saveBtn"
                onclick="doSave('toutiao', getToutiaoConfObj())">
            <i class="fa fa-cog fa-spin fa-fw" style="display:none" onclick="$.alert('<b>开启：</b>仅同步文章到草稿，需要手动发布<br/><b>关闭：</b>直接发布文章，进入审核环节', '说明')"></i>
            保存
        </button>
    </div>
</div>
<script>
    function getToutiaoConfObj(){
        return {
            "draftOnly" : $('#toutiao_draftOnly').is(":checked"),
            "enable" : $('#toutiao_enable').is(":checked"),
            "mediaId": $('#toutiao_mediaId').val(),
            "cookie" : $('#toutiao_cookie').val()
        }
    }
</script>
#end
